
function openEmployee(title, basePath) {
	var href = basePath + "employee/employee.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openFlow(title, basePath) {
	var href = basePath + "officeauto/officeindex.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openSelfFlow(title, basePath) {
	var href = basePath + "selfflow/selfflowindex.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openRunFlow(title, basePath) {
	var href = basePath + "runflow/runindex.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openFileResource(title, basePath) {
	var href = basePath + "fileresource/fileindex.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openDataReport(title, basePath) {
	var href = basePath + "datareport/dataindex.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function openOrganization(title, basePath) {
	var href = basePath + "organization/organization.do";
	var tt = $("#tt");
	if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab  
        tt.tabs('select', title);  
        refreshTab({tabTitle:title,url:href});
	} else {
		var content = '<iframe frameborder="0" scrolling="true" src="'+href+'"'
			+'style="width:100%;height:100%;position:relative;"></iframe>';
		tt.tabs('add',{  
            title:title,  
            closable:true,  
            content:content,  
        });  
	}
}

function refreshTab(cfg){  
    var refresh_tab = cfg.tabTitle ? $('#tt').tabs('getTab',cfg.tabTitle) : $('#tt').tabs('getSelected');  
    if(refresh_tab && refresh_tab.find('iframe').length > 0){  
        var _refresh_ifram = refresh_tab.find('iframe')[0];  
        var refresh_url = cfg.url?cfg.url:_refresh_ifram.src;  
        _refresh_ifram.contentWindow.location.href=refresh_url;  
    }  
}